import { Commit } from "vuex";

interface IDiscountNav {
  id: number;
  title: string;
}

interface IDiscountSuper {
  activity: number;
  activityEndTime: string;
  addtime: string;
  beforePriceLabelType: number;
  categoryId: number;
  cid: number;
  copyPic: "";
  discount: number;
  dsr: number;
  dtitle: string;
  goodsid: string;
  huodongType: number;
  hzQuanOver: number;
  id: number;
  isDelete: number;
  isHaitao: number;
  isOnline: number;
  isVideo: number;
  istmall: number;
  jiage: number;
  jihuaLink: string;
  jinpaimaijia: number;
  market_group: [];
  miaoshu: string;
  neirong: string;
  pic: string;
  qqPic: string;
  quanId: string;
  quanJine: number;
  quanLink: string;
  quanNum: number;
  quanOver: number;
  quanTiaojian: string;
  quanTime: string;
  sellerId: string;
  special: string;
  specialGroupId: [];
  specialText: [];
  startTime: string;
  superPic: string;
  title: string;
  tkZsId: number;
  todayClick: number;
  todayTuiguang: number;
  videoUrl: string;
  xiaoliang: number;
  yongjin: number;
  yuanjia: number;
  yunfeixian: number;
  zhongfen: number;
}

interface IDiscountLIST {
  activity: number;
  activityEndTime: string;
  addtime: string;
  beforePriceLabelType: number;
  categoryId: number;
  cid: number;
  copyPic: "";
  discount: number;
  dsr: number;
  dtitle: string;
  goodsid: string;
  huodongType: number;
  hzQuanOver: number;
  id: number;
  isDelete: number;
  isHaitao: number;
  isOnline: number;
  isVideo: number;
  istmall: number;
  jiage: number;
  jihuaLink: "";
  jinpaimaijia: number;
  market_group: [];
  miaoshu: string;
  neirong: string;
  pic: string;
  qqPic: string;
  quanId: string;
  quanJine: number;
  quanLink: string;
  quanNum: number;
  quanOver: number;
  quanTiaojian: string;
  quanTime: string;
  sellerId: string;
  shopLabel: string;
  special: string;
  specialGroupId: string[];
  specialText: string[];
  startTime: string;
  superPic: string;
  title: string;
  tkZsId: number;
  todayClick: number;
  todayTuiguang: number;
  videoUrl: "";
  xiaoliang: number;
  yongjin: number;
  yuanjia: number;
  yunfeixian: number;
  zhongfen: number;
}

interface IState {
  discountNav: Partial<IDiscountNav>[];
  discountSuper: Partial<IDiscountSuper>[];
  discountList: Partial<IDiscountLIST>[];
}
interface IDiscount {
  namespaced: boolean;
  state: IState;
  actions: {
    getDiscountNav: ({ commit }: { commit: Commit }) => void;
    getDiscountSuper: ({ commit }: { commit: Commit }) => void;
    getDiscountList: (
      { commit }: { commit: Commit },
      { cId }: { cId: number }
    ) => void;
  };
  mutations: {
    GET_DISCOUNT_NAV: (
      state: IState,
      action: { type: string; payload: Partial<IDiscountNav>[] }
    ) => void;
    GET_DISCOUNT_SUPER: (
      state: IState,
      action: { type: string; payload: Partial<IDiscountSuper>[] }
    ) => void;
    GET_DISCOUNT_LIST: (
      state: IState,
      action: { type: string; payload: Partial<IDiscountLIST>[] }
    ) => void;
  };
}

export default IDiscount;
